import { Card } from "antd";
import { Fragment } from "react";
import { Link } from "react-router-dom";
import Fromnow from '../compoment/fromnow'

export default function Detail (props){
    let {loading,data}=props
    let{author,content,create_at,title,visit_count}=data
    return <>
    <Card type={'inner'} bordered loading={loading} title={<Fragment><h1>
        {title}
        </h1>
        <p>-作者：<Link to={`/user/${author.loginname}`}>{author.loginname}</Link>
        -创建时间：<Fromnow data={create_at}/> -浏览人数：{visit_count}</p>
        </Fragment>}>
        <div dangerouslySetInnerHTML={{
            __html:content
        }}></div>
    </Card>
    </>
}